Skip to content

Conversation

@cubercsl
Copy link
Contributor

@cubercsl cubercsl commented Jul 5, 2025

Related to #2252, just for a POC now.

Lack of testing, and I'm not sure how much impact such a query would have on performance when there are a large number of teams polling for updates.

->setParameter('team', $team)
->andWhere('s.submittime < c.endtime')
->andWhere('j.valid = 1')
->andWhere('j.seen = 0');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a migration missing? seen doesn't exist yet, does it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[ORM\Column(options: ['comment' => 'Whether the team has seen this judging', 'default' => 0])]
#[Serializer\Exclude]
private bool $seen = false;

But this may not be important, because the logic of whether to send notifications does not look at this field, (which is at sendNotification @ domjudge.js)

Copy link
Contributor Author

@cubercsl cubercsl Jul 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, this SQL query is the same as the one a user access /api/contests/:cid/judgements, except it filters out entries they have ever seen (it will be marked as seen when they click the submission).

Therefore, it is also feasible to implement it directly on the frontend js instead of adding a function to the /update endpoint.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When are we setting the seen to true? I assume we already do this.

@cubercsl cubercsl force-pushed the feat/submission-notification branch 2 times, most recently from d6d9118 to 32b9f38 Compare September 18, 2025 15:21
@cubercsl cubercsl force-pushed the feat/submission-notification branch from 32b9f38 to 44d7fee Compare September 18, 2025 15:36
@cubercsl cubercsl marked this pull request as ready for review November 24, 2025 14:31
@cubercsl
Copy link
Contributor Author

cubercsl commented Nov 24, 2025

Have tested in some ICPC Asia East Reginal Contests this month.

Here is a reaction desktop video for selected team open this feature.

reaction-desktop.webm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants